/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};

/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {

/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId])
/******/ 			return installedModules[moduleId].exports;

/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			exports: {},
/******/ 			id: moduleId,
/******/ 			loaded: false
/******/ 		};

/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);

/******/ 		// Flag the module as loaded
/******/ 		module.loaded = true;

/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}


/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;

/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;

/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";

/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ function(module, exports, __webpack_require__) {

	/**
	 * Created by Administrator on 2017/3/10.
	 *
	 * ref:必须 为button设置唯一ref,方便操作
	 * onclick：必须，函数返回值为true才执行倒计时
	 * count:倒计时秒数，默认5秒
	 *
	 */
	var GetCode = __webpack_require__(18);

	var Root = React.createClass({displayName: "Root",
	    componentDidMount:function(){
	        UEventHub.on('getcode',function(v){
	            if(v == PageDM.getCode){
	                this.refs.test.toCount();
	            }else{
	                this.refs.test1.toCount();
	            }
	        }.bind(this));
	    },
	    render:function(){
	        return(
	            React.createElement("div", null, 
	                React.createElement(GetCode, {className: "ucs-btn-full", ref: "test", count: 5, onclick: PageDM.getCode.onClick}), 
	                React.createElement(GetCode, {className: "ucs-btn-confirm", ref: "test1", count: 15, onclick: PageDM.getCode2.onClick})
	            )
	        )
	    }
	});
	ReactDOM.render(React.createElement(Root, null), document.getElementById('main'));

/***/ },

/***/ 18:
/***/ function(module, exports) {

	/**
	 * Created by Administrator on 2017/3/10.
	 */

	var GetCode = React.createClass({displayName: "GetCode",
	    getDefaultProps:function(){
	        return{
	            text:"获取验证码",
	            count: 10
	        }
	    },
	    toCount:function(){
	        var _this = this;
	        var count = _this.props.count,
	            className = _this.props.className,
	            text = _this.props.text;
	        var _node = _this.refs['set-'+_this.props.ref];
	        _node.className = "ucs-btn ucs-btn-disabled "+className;
	        _node.innerHTML = count + "秒后重新获取";
	        _node.disabled = true;
	        var time = setInterval(function(){
	            if(count > 0){
	                count--;
	                _node.innerHTML = count + "秒后重新获取";
	            }else{
	                clearInterval(time);
	                _node.className = "ucs-btn "+className;
	                _node.innerHTML = text;
	                _node.disabled = false;
	            }
	        },1000);
	    },
	    render:function(){

	        //事件监听
	        /*UEventHub.on('getcode',function(v){
	            if(v){

	            }
	        });*/
	        return(
	            React.createElement("button", {ref: "set-" + this.props.ref, onclick: this.props.onclick, className: "ucs-btn "+this.props.className}, this.props.text)
	        )
	    }
	});
	module.exports = GetCode;

/***/ }

/******/ });